COLLISION EVENT: Using the collision event, you can detect when two sprites are touching.
When a collision event is triggered by sprites touching, it is automatically passed each sprite as parameters. The sprite parameter refers to the sprite in the event handler. hit_sprite refers to any other sprite that touches sprite.
- Click Run and see what happens. That was unexpected! Let's change the event to the shark's advantage.
- Switch the assignment of all actions in the event from hit_sprite to sprite and from sprite to hit_sprite.
To navigate the page using the TAB key, first press ESC to exit the code editor.